var mongoose = require('mongoose')

var db = mongoose.connect('mongodb://localhost:27017/xzq')

mongoose.connection.on('connected',function(){
	console.log("success connect db")
})

mongoose.connection.on('error',function (err) {    
    console.log('链接出错');  
}); 

var Schema = mongoose.Schema;
var studentschema = new Schema({
		name:{ type: String },
		age:{type: Number},
		major:{ type: String },
		sex:{ type: String },
		tel:{type: Number},
		stuid:{type: Number},
		home:{ type: String }
})


module.exports = mongoose.model('Student',studentschema);
